﻿<Grid x:Class="TouchExplorer.TouchDirectoryDisplayTile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:TouchControls="clr-namespace:TouchControls;assembly=TouchControls" mc:Ignorable="d"              
             d:DesignHeight="300" d:DesignWidth="300"
            Width="106" Height="106" Margin="0 0 4 4">
    <Grid Margin="6">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <TextBlock HorizontalAlignment="Stretch" Text="{Binding Name, Mode=OneTime}" Style="{StaticResource WhiteText}" Margin="0 0 0 2" />
        <Image x:Name="ImgElement" Grid.Row="1" MaxWidth="64" MaxHeight="64" Stretch="Uniform" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
    </Grid>
    <Grid.Triggers>
        <EventTrigger RoutedEvent="TouchControls:Tile.Loaded">
            <BeginStoryboard>
                <Storyboard Name="ItemLoad">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Grid.Opacity)"   
                            From="0.0" To="1" Duration="0:0:0.3" />
                    <!--<DoubleAnimation   
                            Storyboard.TargetProperty="(Grid.Height)"   
                            From="0" Duration="0:0:0.25" />-->
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="TouchControls:Tile.Unloaded">
            <BeginStoryboard>
                <Storyboard Name="ItemUnload">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Grid.Opacity)"   
                            From="1" To="0" Duration="0:0:0.3" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Grid.Triggers>
</Grid>
